package com.qf.pojo.resp;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 响应信息
 */
@Data
@Api("响应信息实体类")
@AllArgsConstructor
@NoArgsConstructor
public class BaseResp {
    @ApiModelProperty(value = "响应信息编号")
    private Integer code;
    @ApiModelProperty(value = "响应信息消息")
    private String message;
    @ApiModelProperty(value = "响应信息实体")
    private Object data;
    @ApiModelProperty(value = "响应信息总数")
    private Long total;
    @ApiOperation(value = "响应成功方法")
    public BaseResp SUCCESS(){
        return new BaseResp(1,"success",null,null);
    }
    @ApiOperation(value = "响应失败的方法")
    public BaseResp ERROR(){
        return new BaseResp(0,"error",null,null);
    }
    @ApiOperation(value = "响应报错的方法")
    public BaseResp UnAuthor() {return new BaseResp(0,"没有权限,请联系管理员",null,null);}
}
